﻿using ReflectionStudio.Core.Events;
using System;
using System.Data;
using System.Windows;
using System.Windows.Data;
using WPFExcelReport.Helpers;
using System.ComponentModel;

namespace WPFExcelReport
{
    public partial class TGBBS6x
    {
        
        public TGBBS6x()
        {
            if (DesignerProperties.GetIsInDesignMode(this))
                return;
            MV = new VGABEW();
            this.DataContext = MV;
            InitializeComponent(); 
        }
        public override void OnEXAUFChg(string vlaue)
        {
            if (!IsAuto)
                return;
            if (EXAUF.Length < 11)
                return;
            dwData = TBMain.NewRow();
            dwData["GABMANDANT"] = app.Mandant;
            dwData["GABAUFKRS"] = EXAUF.Substring(0, 2);
            dwData["GABAUFLFD"] = EXAUF.Substring(2, 6);
            dwData["GABAUFPOS"] = EXAUF.Substring(8, 3);
            SResult = TMV.QGBW09(dwData);
            MergeData(SResult);
            base.OnEXAUFChg(vlaue);
        }
        public override void OnAutoChg(bool value)
        {
            if (!IsAuto)
                return;
            OnEXAUFChg(EXAUF);
            base.OnAutoChg(value);
        }
    }
}
